/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_SUBJECT_H
#define DESIGNPATTERN_SUBJECT_H

#include <memory>
#include "../Observer/Observer.h"

namespace Observer {

    /**
     * 被观察者 主题
     */
    class Subject {
    public:
        virtual void registerObserver(const std::shared_ptr<Observer> &observer) = 0;

        virtual void removeObserver(const std::shared_ptr<Observer> &observer) = 0;

        virtual void notifyObservers() = 0;

        virtual ~Subject() = default;
    };

} // Observer

#endif //DESIGNPATTERN_SUBJECT_H
